<div class="main_width">
    <h1>Thông tin đơn hàng số M-<?php echo $order->order_id;?></h1>
    <div class="news_line main_width"></div>
    <br/>
    <div class="row">
        
        <div class="col-lg-12">
            <table class="table table-striped">
                <thead>
                    <tr>
                        <th width="50" class="text-center">#</th>
                        <th>Tên sản phẩm</th>
                        <th width="180">Hình ảnh</th>
                        <th width="170">Số lượng</th>
                        <th width="150">Đơn giá</th>
                        <th width="150">Tạm tính</th>
                    </tr>
                </thead>
                <tbody>
                    <?php $i = $total = 0 ?>
                    <?php foreach ($order->details as $key => $detail): ?>

                        <tr >
                            <td class="text-center">
                                <?php $i++;
                                echo $i ?></td>
                            <td>
                                <strong><?php echo $detail->product->name; ?></strong>
                                <div  class="cart_container_attr">
                                <?php foreach ($detail->getProperty() as $attr): ?>
                                        <div>

                                        <?php echo $attr['property'] . " : " . $attr['property_value'] ?>
                                        </div>
                                <?php endforeach; ?>
                                </div>
                            </td>
                            <td>
                                <img src="<?php echo urlImageFolder('product') . $detail->product->getImage() ?>" width="100" />
                            </td>
                            <td>
                                <div class="pull-left" style="margin-top:5px">
                                    <?php echo $detail->quantity; ?>
                                </div>

                            </td>
                            <td>
                            <?php echo number_format($detail->product->getPrice(), 0, 0, '.'); ?> VND
                            </td>
                            <td>
                                <?php
                                $total_item = $detail->product->getPrice() * $detail->quantity;
                                $total += $total_item;
                                echo number_format($total_item, 0, 0, '.');
                                ?> VND
                            </td>
                        </tr>
                    <?php endforeach; ?>
                    <tr>
                        <td colspan="4">
                            <a class="btn btn-danger" href="<?php echo Yii::app()->createUrl("user/order")?>"><< Quản lý đơn hàng</a>
                        </td>
                        <td>Tổng Giá</td>
                        <td><?php echo number_format($total, 0, 0, '.'); ?> VND</td>
                    </tr>

                </tbody>
            </table>
        </div>
    </div>

</div>